#{extends 'eventLayout.html' /}
#{set title:messages.get('crud.show.title', event.name) /}
#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/crud.css'}"/>
#{/set}


<div id="crudShow" class="${event.name}">

    <h2 id="crudShowTitle">&{'crud.show.title', event.name}</h2>

    <div class="objectForm">
        <form action="/${event.nick}/save" method="post" enctype="multipart/form-data">
            <div class="crudField crud_text">
                <label for="name">Nombre</label>
                <input id="name" name="event.name" value="${event.name}"/>
            </div>
            <div class="crudField crud_longtext">
                <label for="description">Descripción</label>
                <textarea id="description" name="event.description">
                ${event.description}
                </textarea>
            </div>
            <div class="crudField crud_text">
                <label for="nick">Abreviación</label>
                <input id="nick" name="event.nick" value="${event.nick}"/>
            </div>
            <div class="crudField crud_boolean">
                <label for="active">Activo</label>
                <input id="active" name="event.isActive" checked="${event.isActive}" type="checkbox"/>
            </div>
            <div class="crudField crud_boolean">
                <label for="address">Dirección</label>
                <input id="address" name="event.address" value="${event.address}" type="text"/>
            </div>
            <div class="crudField crud_text">
                <label for="dateBegin">fecha Inicio</label>
                <input id="dateBegin" name="event.dateBegin" value="${event.dateBegin!=null?event.dateBegin.format("yyyy-MM-dd"):''}"/>
            </div>
            <div class="crudField crud_text">
                <label for="dateEnd">fecha Cierre</label>
                <input id="dateEnd" name="event.dateEnd" value="${event.dateEnd!=null?event.dateEnd.format("yyyy-MM-dd"):''}"/>
            </div>
            <p class="crudButtons">
                <input type="submit" name="_save" value="&{'crud.save', event.name}"/>
                <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', event.name}"/>
            </p>
        </form>
    </div>

*{#{form @delete(object._key())}}*
*{<p class="crudDelete">}*
*{<input type="submit" value="&{'crud.delete', type.modelName}" />}*
*{</p>}*
*{#{/form}}*
</div>

<script>
    $(function () {
        $("#dateBegin").datepicker({"dateFormat":'yy-mm-dd'});
        $("#dateEnd").datepicker({"dateFormat":'yy-mm-dd'});
    });
</script>